<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/templates/template.xhtml">

	<ui:define name="content">

		<h:head>
			<h1>Add a car</h1>
		</h:head>
		<body>
			<f:view>
				<h:form>
					<table>
						<tr>
							<td><h:outputLabel value="Class" /></td>
							<td><h:selectOneMenu value="#{form.classes}"
									required="true">
									<f:selectItems value="#{form.classesItems}" />
								</h:selectOneMenu></td>

						</tr>

						<tr>
							<td><h:outputLabel value="Model" /></td>
							<td><h:selectOneMenu value="#{carVendorMB.carVendor.name.toString()}"
									required="true" >
									<f:selectItems value="#{carVendorMB.findAll()}" />
								</h:selectOneMenu></td>

							<td><h:outputLink value="add_model.jsf">
									<h:outputText value="add new model_3" />
								</h:outputLink></td>
						</tr>
			<tr>
							<td><h:outputLabel value="Model" /></td>
							<td><h:selectOneMenu value="#{carVendorMB.carVendor}"
									required="true" >
									<f:selectItems value="#{carVendorMB.findAll()}" />
								</h:selectOneMenu></td>

							<td><h:outputLink value="add_model.jsf">
									<h:outputText value="add new model_3" />
								</h:outputLink></td>
						</tr>						


						<tr>
							<td><h:outputLabel value="Color" /></td>
							<td><h:selectOneMenu value="#{form.colors}"
									required="true">
									<f:selectItems value="#{form.colorItems}" />
								</h:selectOneMenu></td>
						</tr>

						<tr>
							<td><h:outputLabel value="Year" /></td>
							<td><h:selectOneMenu value="#{form.yearOfBirth}"
									required="true">
									<f:selectItems value="#{form.yearItems}" />
								</h:selectOneMenu></td>
						</tr>

						<tr>
							<td><h:outputLabel value="Number" /></td>
							<td><h:inputText id="car_number" required="true" /></td>
						</tr>

						<tr>
							<td><h:outputLabel value="Date start" /></td>
							<td><h:inputText id="car_date_start" required="true" /></td>
						</tr>

						<tr>
							<td><h:outputLabel value="Mileage" /></td>
							<td><h:inputText id="car_mileage_start" required="true" /></td>
						</tr>

						<tr>
							<td><h:outputLabel value="Vin" /></td>
							<td><h:inputText id="car_vin" required="true" /></td>
						</tr>

						<tr>
							<td><h:outputLabel value="Status" /></td>
							<td><h:selectOneMenu value="#{form.status}"
									required="true">
									<f:selectItems value="#{form.statusItems}" />
								</h:selectOneMenu></td>

						</tr>


					</table>

					<div id="Command">
						<h:form>
							<h:commandButton action="#{carMB.doCreate}"
								value="Back to list" />
							<h:commandButton action="#{carMB.doCreate}" value="Save" />
						</h:form>
					</div>



				</h:form>


			</f:view>
		</body>
	</ui:define>
</ui:composition>
</html>